<?php
/**
 *  💡 免责声明：本软件不得用于商业用途，仅做学习交流
 *  ⚠️ 权利声明：本软件由版权人提供产品技术支持
 *  📅 项目编号：NX2025-0135
 */
namespace App\Admin\Actions\Row;

use App\Models\AdvanceCard;
use Dcat\Admin\Grid\RowAction;
use Illuminate\Http\Request;

class AdvanceCardApproveAction extends RowAction
{
    protected $title = '✅ 通过';

    public function handle(Request $request)
    {
        $model = AdvanceCard::query()->findOrFail($this->getKey());
        $model->status = 2;
        $model->save();
        return $this->response()
            ->success('审核通过,该垫付卡已启用！')
            ->refresh();
    }

    public function confirm()
    {
        return '确定要通过审核吗？该垫付卡将启用';
    }
}
